home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / demo / pwrtcp11.exe / CONNECT.FR_ / CONNECT.bin
Text File  |  1994-11-13  |  6KB  |  189 lines

  1. VERSION 2.00
  2. Begin Form frmConnect 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Connect"
  5.    ClientHeight    =   1920
  6.    ClientLeft      =   2115
  7.    ClientTop       =   4170
  8.    ClientWidth     =   3240
  9.    ClipControls    =   0   'False
  10.    Height          =   2325
  11.    Left            =   2055
  12.    LinkTopic       =   "Form3"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1920
  16.    ScaleWidth      =   3240
  17.    Top             =   3825
  18.    Width           =   3360
  19.    Begin TextBox txtHostName 
  20.       Height          =   300
  21.       Left            =   1200
  22.       TabIndex        =   1
  23.       Top             =   240
  24.       Width           =   1455
  25.    End
  26.    Begin CommandButton cmdCancel 
  27.       Cancel          =   -1  'True
  28.       Caption         =   "Cancel"
  29.       Height          =   375
  30.       Left            =   1800
  31.       TabIndex        =   5
  32.       Top             =   1200
  33.       Width           =   1215
  34.    End
  35.    Begin CommandButton cmdConnect 
  36.       Caption         =   "&Connect"
  37.       Default         =   -1  'True
  38.       Height          =   375
  39.       Left            =   240
  40.       TabIndex        =   4
  41.       Top             =   1200
  42.       Width           =   1215
  43.    End
  44.    Begin ComboBox cmbPort 
  45.       Height          =   300
  46.       Left            =   1200
  47.       TabIndex        =   3
  48.       Top             =   600
  49.       Width           =   1815
  50.    End
  51.    Begin Label Label2 
  52.       Caption         =   "Port:"
  53.       Height          =   495
  54.       Left            =   120
  55.       TabIndex        =   2
  56.       Top             =   600
  57.       Width           =   1215
  58.    End
  59.    Begin Label Label1 
  60.       Caption         =   "Host Name:"
  61.       Height          =   495
  62.       Left            =   120
  63.       TabIndex        =   0
  64.       Top             =   240
  65.       Width           =   1215
  66.    End
  67. End
  68. ' TELNET Action Property values
  69. Const CONNECT = 0
  70. Const LISTEN = 1
  71. Const CLOSECOMM = 2
  72. Const ABORTCOMM = 3
  73.  
  74. ' TELNET CommState Property Values
  75. Const CLOSED = 1
  76. Const CONNECTING = 2
  77. Const CONNECTED = 3
  78. Const LISTENING = 4
  79. Const CLOSING = 5
  80.  
  81. ' TELNET commands
  82. Const GO_AHEAD_CMD = 249
  83. Const WILL_CMD = 251
  84. Const WONT_CMD = 252
  85. Const DO_CMD = 253
  86. Const DONT_CMD = 254
  87. Const SB_CMD = 250
  88.     
  89. ' Telnet options
  90.  
  91. ' NOTE: These are not all possible options. New options
  92. ' are currently being defined. This list contains many
  93. ' of the common ones you may use.
  94.  
  95. Const BINARY_TRANSMISSION = 0
  96. Const ECHO = 1
  97. Const RECONNECTION = 2
  98. Const SUPPRESS_GO_AHEAD = 3
  99. Const MESSAGE_SIZE = 4
  100. Const STATUS = 5
  101. Const TIMING_MARK = 6
  102. Const REMOTE_CONTROLLED = 7
  103. Const OUTPUT_LINE_WIDTH = 8
  104. Const OUTPUT_PAGE_SIZE = 9
  105. Const OUTPUT_RETURN_DISPOS = 10
  106. Const OUTPUT_HORIZ_TABSTOPS = 11
  107. Const OUTPUT_HORIZ_TAB_DISPOS = 12
  108. Const OUTPUT_FORM_FEED_DISPOS = 13
  109. Const OUTPUT_VERT_TABSTOPS = 14
  110. Const OUTPUT_VERT_TAB_DISPOS = 15
  111. Const OUTPUT_LINE_FEED_DISPOS = 16
  112. Const EXTENDED_ASCII = 17
  113. Const LOGOUT = 18
  114. Const BYTE_MACRO = 19
  115. Const DATA_ENTRY_TERMINAL = 20
  116. Const SUPDUP = 21
  117. Const SUPDUP_OUTPUT = 22
  118. Const SEND_LOCATION = 23
  119. Const TERMINAL_TYPE = 24
  120. Const END_OF_RECORD = 25
  121. Const TACACS_USER_ID = 26
  122. Const OUTPUT_MARKING = 27
  123. Const TERMINAL_LOC_NUM = 28
  124. Const REGIME_3270 = 29
  125. Const X3_PAD = 30
  126. Const WINDOW_SIZE = 31
  127.  
  128. ' TNT Error Values
  129. Const PT_OK = 0              '/* OK...ErrorDesc should be NULL                             */
  130. Const PT_HARDWARE = 1        '/* hardware failure                                          */
  131. Const PT_PROTOCOL = 2        '/* protocol software failure                                 */
  132. Const PT_BADNAME = 3         '/* name of host cannot be resolved to address                */
  133. Const PT_CONNREFUSED = 4     '/* connection to host refused                                */
  134. Const PT_NOROUTE = 5         '/* no route to host (check network part of address)          */
  135. Const PT_NOHOST = 6          '/* remote host is not available (check host part of address) */
  136. Const PT_NOMEM = 7           '/* insufficient resources to accept buffer or create channel */
  137. Const PT_ADDRINUSE = 8       '/* address/port in use                                       */
  138. Const PT_ALREADYOPEN = 9     '/* PowerTCP daemon/session already open                      */
  139. Const PT_CLOSED = 10         '/* graceful close by remote host or us                       */
  140. Const PT_ABORTED = 11        '/* connection aborted by remote host or us                   */
  141. Const PT_NOTOPEN = 12        '/* attempt made to use a closed session                      */
  142. Const PT_NODEVLICENSE = 13   '/* not licensed for development (fatal error)                */
  143. Const PT_NORTLICENSE = 14    '/* not licensed for runtime (non-fatal error)                */
  144. Const PT_SOFTWARE = 15       '/* general software error                                    */
  145. Const PT_WARNING = 16        '/* general warning                                           */
  146. Const PT_ERROR = 17          '/* general error                                             */
  147.  
  148. Sub cmdCancel_Click ()
  149.     Me.Hide
  150. End Sub
  151.  
  152. Sub cmdConnect_Click ()
  153.     Me.Hide
  154.  
  155.     ' Select from the different standard telnet ports
  156.     Select Case cmbPort
  157.     Case "telnet"
  158.         ' Standard telnet
  159.         frmTelnet.TNT1.RemotePort = 23
  160.     Case "echo"
  161.         ' Echos back whatever is sent
  162.         frmTelnet.TNT1.RemotePort = 7
  163.     Case "discard"
  164.         ' Does not echo back what is sent
  165.         frmTelnet.TNT1.RemotePort = 9
  166.     Case "daytime"
  167.         ' Returns the date and time
  168.         frmTelnet.TNT1.RemotePort = 13
  169.     Case "chargen"
  170.         ' Generates a stream of characters
  171.         frmTelnet.TNT1.RemotePort = 19
  172.     Case Else
  173.         frmTelnet.TNT1.RemotePort = Val(cmbPort)
  174.     End Select
  175.     
  176.     frmTelnet.TNT1.RemoteHost = txtHostName
  177.     frmTelnet.TNT1.Action = CONNECT
  178. End Sub
  179.  
  180. Sub Form_Load ()
  181.     cmbPort.AddItem "telnet"
  182.     cmbPort.AddItem "echo"
  183.     cmbPort.AddItem "discard"
  184.     cmbPort.AddItem "daytime"
  185.     cmbPort.AddItem "chargen"
  186.     cmbPort.ListIndex = 0
  187. End Sub
  188.  
  189.